var box7 = echarts.init(document.getElementById("box7"))
function resizeChart(){
  box7.resize()
}
window.addEventListener('resize',resizeChart)
var option = {
    title: {
      text: '开发人员的薪资分布'
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      },
        formatter:function(params){
            console.log(params)
            var res = params[0].name;
            for(var i = 0; i < params.length; i++){
                res += '：' +params[i].value +'%'
            }
            return res
        },
    },
    toolbox: {
      show: true,
      feature: {
          mark: {show: true},
          dataView: {show: true, readOnly: false},
          magicType: {show: true, type: ['line', 'bar']},
          restore: {show: true},
          saveAsImage: {show: true}
      }
  },
    legend: {},
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: {
      type: 'value',
      boundaryGap: [0, 0.01]
    },
    yAxis: {
      type: 'category',
      data: ['17001-30000元','8001-17000元','5001-8000元','小于5000元']
    },
    series: [
      {
        name: '月薪',
        type: 'bar',
        data: [16, 45, 23, 11]
      }
    ]
  };
  box7.setOption(option)